// 如果一个类定义在某个包中，那么package语句应该在源文件的首行
package com.cakin.javademo;
// 如果源文件包含import语句，那么应该放在package语句和类定义之间。
import java.util.Date;

/**
 * @ClassName: com.cakin.javademo.Dog
 * @Description: 狗实体类，pojo，entity
 * @Date: 2020/6/11
 * @Author: cakin
 */
public class Dog {
    // 成员变量
    private String name;
    private int age;
    private String color;
    // 类变量
    private static int NUM = 0;
    // 有参构造函数
    public Dog(String name, int age, String color) {
        this.name = name;
        this.age = age;
        this.color = color;
    }
    // 无参构造函数
    public Dog() {
    }

    /**
     * 功能描述：普通方法
     *
     * @author cakin
     * @date 2020/6/11
     */
    public void run(){
        int num = 8;
        System.out.println("狗可以跑！");
    }

    public void bark(){
        System.out.println("狗可以叫");
    }
    public void sleep(){
        System.out.println("狗可以睡觉");
    }

    public static void main(String[] args) {
        Dog dog = new Dog("小花", 2, "black");
        System.out.println(dog);
        Math.abs(-5);
        Date date;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public static int getNUM() {
        return NUM;
    }

    public static void setNUM(int NUM) {
        Dog.NUM = NUM;
    }

    @Override
    public String toString() {
        return "com.cakin.javademo.Dog{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", color='" + color + '\'' +
                '}';
    }
}


